package com.hnas.trade.domain;

public enum DetailType {

	VIP("0","VIP"),
	COUPON("1","代金券"),
	MrchDiscount("2","商家打折"),
	EmpDiscount("3","员工折扣"),
	ActivityDiscount("4","活动优惠");
	
	
	private String key;
	
	private String value;

	private DetailType(String key, String value) {
		this.key = key;
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	public static DetailType getValue(String key) {
		for (DetailType value : DetailType.values()) {
			if (value.getKey().equals(key)) {
				return value;
			}
		}
		return null;
	}
	
	public static String getDetailTypeValue(String key) {
		return getValue(key) == null ? "" : getValue(key)
				.getValue();
	}
	
}
